package com.clps.cn;

import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngines;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.runtime.ProcessInstance;
import org.junit.Test;

/**
 * 启动流程实例
 */
public class ActivitiStartInstance {


    @Test
    public  void  test001(){
        //得到ProcessEngline的对象
        ProcessEngine defaultProcessEngine = ProcessEngines.getDefaultProcessEngine();
        //得到runServicxe对象
        RuntimeService runtimeService = defaultProcessEngine.getRuntimeService();
    }



    public static void main(String[] args) {

        //得到ProcessEngline的对象
        ProcessEngine defaultProcessEngine = ProcessEngines.getDefaultProcessEngine();
        //得到runServicxe对象
        RuntimeService runtimeService = defaultProcessEngine.getRuntimeService();
        //03创建实例，定义流程的key
        ProcessInstance holiday = runtimeService.startProcessInstanceByKey("holiday");
        //输出结果
        System.out.println("holiday = " + holiday.getId());
        System.out.println("holiday.getDeploymentId() = " + holiday.getDeploymentId());
        System.out.println("holiday.getActivityId() = " + holiday.getActivityId());



    }
}
